package com.lge.clock.alarmclock;
 
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;

import com.lge.clock.util.Log;

/**
 * @author LGE Cappuccino
 */
public class VTCallReceiver extends BroadcastReceiver {
	private static final String TAG = "VTCallReceiver";
	private static final String PREFERENCES = "VT_CALL_IN_OR_OUT_STATE";
	/*[START] 2012.03.05 suein1209.kim VT Call State issue*/
	private static final String IN_VT_CALL_STATE = "lg_vt_in_call"; 
	private static final String OUT_VT_CALL_STATE = "lg_vt_out_call"; 
	/*[END] 2012.03.05 suein1209.kim VT Call State issue*/

    /**
     * Method onReceive.
     * @param context Context
     * @param intent Intent
     */
    @Override
	public void onReceive(Context context, Intent intent) {
		Log.d(TAG, "==[[ VTCallReceiver intent ]]===> " + intent.getAction() );
        
        /*[START] 2012.03.05 suein1209.kim VT Call State issue*/
        SharedPreferences mVtCallPrefs = context.getSharedPreferences("VT_CALL_IN_OR_OUT_STATE", 0);
        String intentAction = intent.getAction();
        if (IN_VT_CALL_STATE.equalsIgnoreCase(intentAction)){
        	mVtCallPrefs.edit().putBoolean ("VTCALL_IN_STATE", true).commit();
        }else if(OUT_VT_CALL_STATE.equalsIgnoreCase(intentAction)){
        	mVtCallPrefs.edit().putBoolean ("VTCALL_IN_STATE", false).commit();
        } //End of if
    } //End Of onReceiver
} //End Of Class VTCallReceiver

